
local WaitTime=10
local function Init(component,RunSpace)
	local IsSuccess = nil;
	local data = nil;
	while not IsSuccess do --直到加载成功
		local s, d = xpcall(function()
			return require(RunSpace:WaitForChild("OHOH", WaitTime):WaitForChild(component, WaitTime):WaitForChild(component .. "OHOH", WaitTime));
		end, debug.traceback);
		IsSuccess = s;
		data = d;
		if not IsSuccess then
			warn(data);
			wait();
		end;	
	end; 
	
	return data;
end;

local common = Init("Common",game:GetService("ReplicatedStorage")); --公共组件
_G.GameAnalyticsServerInit = common.load.GameAnalyticsServerInit()
Init("Server",game:GetService("ServerScriptService")).load.GameServer().new():Start()

--Init("Server",game:GetService("ServerScriptService")).load.GameServer().new()

------------------Test----------------------
--local ServerOHOH = _G.ServerOHOH;

--local testSub=ServerOHOH.load.TestSub().new()
--testSub:WaitPrint()
--delay(5,function()
--	testSub:EndWaitPrint()

--end)
--local A1= Instance.new("Folder",workspace)
--local A2= Instance.new("Folder",workspace)

--local TestObjA2=ServerOHOH.load.TestObjA2().new(A1)
--local TestObjA1=ServerOHOH.load.TestObjA1().new(A2)
--TestObjA1.CompentA1:F1()

-- coroutine.wrap(function()
-- 	require(script:WaitForChild("GameCenter"))
-- end)